Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

various fixes / additions to math node. --- Pass 1 #25

Merged
merged 12 commits into from
Feb 5, 2017
Merged

Conversation

zeffii
Copy link
Contributor

@zeffii zeffii commented Feb 5, 2017

pushing early to have something to work with..

See below a list of issues encountered during rudimentary testing. Some of these will make it into the eventual docs highlighting the potentially unexpected behavior.


The modes of math node

  • SQRT
  • NEG
  • SUB
  • MUL
  • ADD
  • DIV
    • div autoconverts for instance 180/60 into 3. (float) ... use INTDIV if you know that the two values will divide without remainder, or if you don't care about the remainder.
  • ABS
  • CEIL
    • outputs a float
  • COPY SIGN
    • copysign autoconverts ints to float output. (I think this is not expected behaviour)
  • ROUND-N
  • FMOD
  • MODULO
  • FLOOR
  • EXP
  • LN
  • LOG1P
  • LOG10
  • INTDIV
  • POW
  • E
  • MIN
  • MAX
  • 1/x

are not implemented in this node, instead their counterparts use sane defaults to produce the same results.

  • ROUND
  • POW2
  • -1
  • +1
  • *2
  • /2

@zeffii
Copy link
Contributor Author

zeffii commented Feb 5, 2017

I think we can economise a little in the following ways, reducing the number of items will make the whole menu more compact and put the default values to good use.

instead of having ADD and +1 , the default to Y in Add could be 1 (one less mode)
instead of having SUB and -1 , the default to Y in Add could be 1 (one less mode)
instead of having MUL and *2 , the default to Y in Add could be 2 (one less mode)
instead of having DIV and /2 , the default to Y in Add could be 2 (one less mode)
instead of having ROUND and ROUND_N, just have round N with a default Y 0. (one less mode)
instead of having POW and POW2, just have POW with a default Y 2. (one less mode)..

6 fewer nodes :)

Done

@zeffii
Copy link
Contributor Author

zeffii commented Feb 5, 2017

on the other hand... sometimes you do kind of want to lock a node's input to remind your future self not to change it.

@ly29
Copy link
Contributor

ly29 commented Feb 5, 2017

Having the extra modes brings a slight cost.

@zeffii zeffii changed the title various fixes / additions to math node. various fixes / additions to math node. Pass 1 Feb 5, 2017
@zeffii zeffii changed the title various fixes / additions to math node. Pass 1 various fixes / additions to math node. --- Pass 1 Feb 5, 2017
@zeffii
Copy link
Contributor Author

zeffii commented Feb 5, 2017

it's all there now, bugs might be lurking :)

@zeffii zeffii merged commit e335e6b into master Feb 5, 2017
@zeffii zeffii deleted the math_node_fixes branch February 5, 2017 16:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants