sicm | Unofficial HTML version of Sussman and Wisdom
kandi X-RAY | sicm Summary
kandi X-RAY | sicm Summary
Unofficial HTML version of Sussman and Wisdom's "Structure and Interpretation of Classical Mechanics"
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of sicm
sicm Key Features
sicm Examples and Code Snippets
Community Discussions
Trending Discussions on sicm
QUESTION
This code is taken from Sussman and Wisdom's Structure and Interpretation of Classical Mechanics, its purpose is to derive (close to) the smallest positive floating point the host machine supports. https://github.com/hnarayanan/sicm/blob/e37f011db68f8efc51ae309cd61bf497b90970da/scmutils/src/kernel/numeric.scm
Running it in DrRacket results in 2.220446049250313e-016 on my machine.
My question, what causes this to even return a value? This code is tail recursive, and it makes sense at some point the computer can no longer divide by 2. Why does it not throw?
...ANSWER
Answered 2020-Jan-22 at 20:22This code is tail recursive, and it makes sense at some point the computer can no longer divide by 2. Why does it not throw?
No, the idea is different: at some point the computer still can divide by 2, but the result (e
) becomes indistinguishable from 0 [upd: in the context of floating-point addition only - very good point mentioned in the comment] (e + 1.0 = 1.0
, this is exactly what if
clause is checking). We know for sure that the previous e
was still greater than zero "from the machine point of view" (otherwise we wouldn't get to the current execution point), so we simply return e*2
.
QUESTION
I have a class that is located in a namespace folder, and within this namespace folder it is inside a class folder. Thus, the directory structure is
...ANSWER
Answered 2019-Jun-19 at 17:31it seems that my initial hunch is correct: the functionSignature.json
file needs to be in whichever directory you add to the MATLAB path to use the functions. Since namespace directories are not directly added to the path, but their parent directory is, the functionSignature.json
directory needs to be in the parent directory of the namespace directory.
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install sicm
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page