Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

[Closed] 4.6.1 Pure Function - Float Input resets to 0

The editor really doesn't like it when you divide by 0. So when my float variable plugged into the input of a pure function gets set to 0 on it's way in, it just ruins my day. :p

The Variable(.16) plugs into the pure function, which on the inside multiplies an Int(100), and then goes into the bottom of a float divide node(1000 on top).

I took the pure function out of the process, no problems. I plugged it back in, unplugged the line from the input and manually set the float, also no problems.

This only happens when the input is coming from outside the Pure Function.

Product Version: Not Selected
more ▼

asked Jan 12 '15 at 01:43 PM in Bug Reports

avatar image

1.8k 131 68 110

avatar image Doug E ♦♦ STAFF Jan 12 '15 at 07:39 PM

Hey Zeustiak-

I created a variable with a default value of .16 and fed it into a pure function as you described. I then returned the value after the multiplication and division (1000 / (100 x .16)) and printed it to the screen which printed 62.5 as expected. Is the variable being set by something else before being passed into the pure function? If so you may want to try Omnicypher's suggestion of doing a check of the variable's value before using it.


Doug Wilson

avatar image Zeustiak Jan 14 '15 at 10:52 AM

Yeah it was a problem with the variable not being set.

Apparently when I renamed 2 int variables it dropped their links heading into an interface. Not sure if that is supposed to do that, but the main issue has been resolved.

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

The question has been closed Jan 14 '15 at 10:55 AM by Zeustiak for the following reason:

Changing a variable name dropped lines going into an interface, resulting in 0.

1 answer: sort voted first

inside the function, you can check if X == 0, and branch into different logic for that special case. maybe you want it to return the highest number that type can hold, maybe you want to return 0, maybe you want to log an error, it depends on what this function is supposed to accomplish.

what is the goal of this function? what does the returned number represent? what is the behavior you want to happen when X==0?

more ▼

answered Jan 12 '15 at 03:11 PM

avatar image

9.6k 320 205 450

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question