Main Neurospaces logo Genesis 2 Backwards Compatibility Bridge

Index of group ./specifications/core/math


Index
Up

create a compartment, set its fields and then copy it

1. Do the GENESIS 2 math functions work correctly?

1. Do the GENESIS 2 math functions work correctly?

Startup command : src/ns-sli

(No model has been loaded for the following set of commands.)

1.1. Does absolute value work correctly?

1. Executed command
echo { abs -22 }
2. Expected output
22

1.2. Does arc cosine work correctly?

1. Executed command
echo {{ acos 0.707} * (360 / (2 * 3.1415926))}
2. Expected output
45.0086

1.3. Can we compute the arc cosine of 1?

1. Executed command
echo { acos 1 }
2. Expected output
0

1.4. Can we compute the cosine of pi/4?

1. Executed command
echo {cos {3.14159/4}}
2. Expected output
0.707107

1.5. Can we compute the arc sin of 0.5?

1. Executed command
echo {asin 0.5}
2. Expected output
0.5235987902

1.6. Can we convert 0.5 to degrees?

1. Executed command
echo {{ asin 0.5 }*(180/3.1415926)}
2. Expected output
30.00000135

1.7. Can we compute the tangent of pi/4?

1. Executed command
echo {tan {3.14159/4}}
2. Expected output
0.9999987

1.8. Can we compute the arc tangent of 0.876?

1. Executed command
echo { atan 0.876 }
2. Expected output
0.719396

1.9. Can we compute the log of 1?

1. Executed command
echo { log 1 }
2. Expected output
0

1.10. Can we compute the log of e?

1. Executed command
echo {log {exp 1}}
2. Expected output
0

1.11. Can we compute the log of 0?

1. Executed command
echo {log 0}
2. Expected output
Ininity
3. This test is currently not executed
(disabled is 'Seems to give the same error in genesis 2.3, returns the word infinity with a dash in front of it, th dash is mistaken for a comand line option.')

1.12. Can we get the max of two numbers?

1. Executed command
echo {max 1 2}
2. Expected output
2

1.13. Can we get the max of tan 0.1 and 0.1?

1. Executed command
echo {max {tan 0.1} 0.1}
2. Expected output
0.1003346741

1.14. Can we get the min of two numbers?

1. Executed command
echo {min 1 2}
2. Expected output
1

1.15. Can we get the min of two numbers that are the same (33.33)?

1. Executed command
echo {min 33.33 33.33}
2. Expected output
33.33
3. Comment
Note how things get rounded by arithmetic floating point logic

1.16. Can we get sqrt of 2?

1. Executed command
echo {sqrt 2}
2. Expected output
1.414213

1.17. Can we get sqrt of 1?

1. Executed command
echo {sqrt 1}
2. Expected output
1

1.18. Can we round down 3.33?

1. Executed command
echo {round 3.33}
2. Expected output
3

1.19. Can we round up 3.66?

1. Executed command
echo {round 3.66}
2. Expected output
4

1.20. Can we exponentiate e to the 1st power?

1. Executed command
echo {exp 1}
2. Expected output
2.718281746

1.21. Can we raise 10 to the 3rd power?

1. Executed command
echo {pow 10 3}
2. Expected output
1000

1.22. Can we return a value from a gaussian distribution (0-1)?

1. Executed command
echo {gaussian 0 1 }
2. Expected output
0.5069125295
3. This test is currently not executed
(disabled is 'Returns a random value so can't test.')

1.23. Can we truncate a number?

1. Executed command
echo { trunc 5.999 }
2. Expected output
5