New answers tagged

6

This is not an answer. But I don't believe we should close this question as "easily found in the documentation". Numerics in Mathematica is an extremely complicated and mostly undocumented subject, where several mathematical concepts run up against each other in subtle and non-trivial ways. I have been thinking for some time that we ought to address this ...


1

It seems that the most straightforward way goes through RealDigits: nextAfter[x_Real] := FromDigits[MapAt[1 + # &, MapAt[0*# &, RealDigits[x, 2], 1], {1, -1}], 2] + x


2

If you have a C compiler you could use C's nextafter directly. Needs["CCompilerDriver`"] ClearAll[nextafter] " #include \"WolframLibrary.h\" DLLEXPORT mint WolframLibrary_getVersion() { return WolframLibraryVersion; } DLLEXPORT int WolframLibrary_initialize(WolframLibraryData libData) { return LIBRARY_NO_ERROR; } DLLEXPORT void ...


2

I was looking for a previous question of which this might be a duplicate; although many previous discussions hinge on precision issues, and the difference has been mentioned in comments, I could not dredge up an explicit discussion of $MachinePrecision vs MachinePrecision through the SE search engine, so I thought I might sum up the discussion in comments, ...



Top 50 recent answers are included