- math:log10(1) returns -0 but -0 returns 0: is there a reason for that?
Thanks! Giuseppe
Universität Leipzig Institute of Computer Science, NLP Augustusplatz 10 04109 Leipzig Deutschland E-mail: celano@informatik.uni-leipzig.de E-mail: giuseppegacelano@gmail.com Web site 1: http://www.dh.uni-leipzig.de/wo/team/ Web site 2: https://sites.google.com/site/giuseppegacelano/
Giuseppe
this is the floating point representation IEEE 754 that allows -0 and 0 both being the same.
Yours Leo
On 26 May 2018, at 17:01, Giuseppe Celano celano@informatik.uni-leipzig.de wrote:
- math:log10(1) returns -0 but -0 returns 0: is there a reason for that?
Thanks! Giuseppe
Hi Giuseppe,
The query -0 yields a minus expression with the integer 0 as argument. The result will be the integer 0. You can view the unoptimized query plan by sending the BaseX command "SET COMPPLAN false" (e.g. in the command input panel on top in the GUI) before running the query.
As Leo indicated, math:log will return a floating point value, which can either be -0 or 0.
Cheers, Christian
Giuseppe Celano celano@informatik.uni-leipzig.de schrieb am Sa., 26. Mai 2018, 17:02:
- math:log10(1) returns -0 but -0 returns 0: is there a reason for that?
Thanks! Giuseppe
Universität Leipzig Institute of Computer Science, NLP Augustusplatz 10 04109 Leipzig Deutschland E-mail: celano@informatik.uni-leipzig.de celano@informatik.uni-leipzig.de E-mail: giuseppegacelano@gmail.com Web site 1: http://www.dh.uni-leipzig.de/wo/team/ Web site 2: https://sites.google.com/site/giuseppegacelano/
basex-talk@mailman.uni-konstanz.de