|Anonymous | Login | Signup for a new account||18-06-21 14:29 CEST|
|Main | My View | View Issues | Change Log | Roadmap|
|View Issue Details|
|ID||Project||Category||View Status||Date Submitted||Last Update|
|0002572||SphereServer||executable - generic||public||23-01-16 15:57||11-07-16 21:43|
|Target Version||Fixed in Version|
|Summary||0002572: FLOATVAL error with ABS and issue with SQRT|
|Description||.show eval ABS(-1) shows 1.|
.show floatval ABS(-1) shows 0.000000 and error in console: Bad intrinsic function usage. missing ).
.show eval SQRT(030) shows 6.
.show eval SQRT(30) shows 5.
So with eval it appear to work properly.
.show floatval SQRT(030) shows 5.77...
.show floatval SQRT(30) shows 5.77...
It's like now it doesn't do the conversion from hex to decimal.
FLOATVAL doesn't show error in console if i put invalid code inside, like .show FLOATVAL arrraaa, where EVAL arrraaa does.
Also, is it possible to have as intrinsic functions also arcsin, arccos, arctan, arccotan? It should be easy to do since they are already in the c++ header <cmath.h> (http://www.cplusplus.com/reference/cmath/ [^]); cotan and arccotan appear to not be included, but cotan is 1/tan and arccotan is 90°-arctan (https://en.wikipedia.org/wiki/Inverse_trigonometric_functions [^]).
|Tags||No tags attached.|
|Nightly Version||Automated (specify build number)|
|Internal Build Number|
these intrinsic functions (FLOATVAL, ABS, ...) usually don't evaluate args, they just read them exactly as it is. So to make the function work properly the args must be already using the correct syntax
<eval ABS(-1)> -> this works fine because EVAL can evaluate all values before the calculation, so it will first resolve ABS(-1) to 1 and later will call 'eval 1'
<floatval ABS(-1)> -> this will not work because FLOATVAL doesn't evaluate the args before the calculation. So instead resolve ABS(-1) to 1 and call 'floatval 1', it will thread ABS(-1) as an numeric value without change it. And since ABS(-1) is an string (text) and not an numeric value, FLOATVAL will fail
to fix this, you must evaluate these values before call intrinsic functions, like this:
<FLOATVAL <eval ABS(-1)>> = <FLOATVAL 1> = 1.000000
the same occur when you call these functions using hex args instead dec, like <FLOATVAL 0a>. The function will thread 0a as numeric, but will fail because it doesn't evaluate args so it doesn't know that 0a (hex) is the same of 10 (dec). So to make it work properly you must fist evaluate this value to dec using something like <FLOATVAL <eval 0a>> or <FLOATVAL 10>
|23-01-16 15:57||nolok||New Issue|
|11-07-16 21:43||Coruja||Note Added: 0003017|
|Copyright © 2000 - 2010 MantisBT Group|