Hello,

I am writing a coloring algo at the moment and I tried using min(val1, val2) where val1 and val2 are two floating point values, and the function does not exist (error: invalid function). So I went looking for an equivalent function and I cannot find one. Does UF not have such a fucntion? It seems like such a basic thing. Am I just overlooking something?

Phillip

Hello, I am writing a coloring algo at the moment and I tried using min(val1, val2) where val1 and val2 are two floating point values, and the function does not exist (error: invalid function). So I went looking for an equivalent function and I cannot find one. Does UF not have such a fucntion? It seems like such a basic thing. Am I just overlooking something? Phillip
 
0
reply

UF doesn't have such. You can use my MyMath class in jlb.ulb. The functions are static, so you don't have to make your own instance of the class. For example:

import "jlb.ulb"

func testing( )
  int i=3, int j=4
  int k=MyMath.imin(i,j)    ; or imax

  float a=6.2, float b=-8.7
  float c=MyMath.fmin(a,b)    ; or fmax
endfunc
UF doesn't have such. You can use my MyMath class in jlb.ulb. The functions are static, so you don't have to make your own instance of the class. For example: ```` import "jlb.ulb" func testing( ) int i=3, int j=4 int k=MyMath.imin(i,j) ; or imax float a=6.2, float b=-8.7 float c=MyMath.fmin(a,b) ; or fmax endfunc ````
 
0
reply

Thanks, that's good to know. I ended up just writing my own for the time being but I'll have a look at your class to see what else I might be able to use smile

Thanks, that's good to know. I ended up just writing my own for the time being but I'll have a look at your class to see what else I might be able to use :)
 
0
reply
40
views
2
replies
2
followers
live preview
Enter at least 10 characters.
WARNING: You mentioned %MENTIONS%, but they cannot see this message and will not be notified
Saving...
Saved
All posts under this topic will be deleted ?
Pending draft ... Click to resume editing
Discard draft