Forum

For fracs sake

Am I wrong in thinking the frac node used to behave differently with negative numbers?

I’m sure that it used to just strip the floating point part from the integer part, so -1.2 would come out as -1 and 0.2

In case I just made this up, is there a node that simply separates a number at the decimal point, giving out two values?

Thanks

frac is correct, it does a floor for the int part. no node for that, but its a simple calculation: -1 - (-1.2) = 0.2

Fair enough.

I see the calculation is straightforward, it just seems cumbersome to then have to use a sign and switch combo to change the calculation depending on whether the input is positive or negative.

thanks

true, i agree that the name Frac should do what you suggest… just splitting the number. for better performance you could do:https://vvvv.org/sites/default/files/imagecache/large/images/callmenames_2011.01.27-18.22.46.png

A more elegant solution, but it isn’t correct for values between 0 and -1

(I can’t upload an image for some reason)

i just checked and the solution in the image seems to work correct in the latest beta. or would you expect something different?

looks like the problem is -0.5 gives the same result as 0.5 (for example)

I can see why it does, so don’t think anything is broken as such

ah, that’s what you meant… interesting… not sure how to solve it either, sounds like a new node maybe Split (Value)?

maybe… I don’t remember this having been a problem since then but who knows what lengths I’ve gone to work around it :)