Comments (9)
from cm3.
Gee, I didn’t even realize FLOOR returns INTEGER. (I’ll change the issue title.)
Actually I was trying to calculate the fractional part of Time.T values, which turned out to be too large. The comment in Math.i3 suggests the reader to use the built-in rounding functions instead; I guess that could be a bit misleading.
Getting checked runtime errors does seem a lot better than getting incorrect results. (Or could something go wrong?)
from cm3.
from cm3.
There’s no problem with the Date interface. I just need a Date.T with a finer resolution, hence the need for the fractional part of Time.T.
from cm3.
from cm3.
How far into the past or future do you need to go?
Not too far from the present thankfully. I think the Posix implementation already uses 64-bit times internally where possible. On Windows Time uses WinBase.FILETIME, which has a resolution of 0.1 ms and is good for about 30,000 years around January 1, 1601.
If you need to convert later dates or with a different epoch you can do a stepwise thing. Divide the time by a nice round number, say 2048, do the floor, subtract it off, multiply by 2048...
Do you mean that if a Time.T is too large for Date.FromTime I can calculate suitable a remainder first, convert it to a Date.T, and then adjust that Date.T accordingly? But then how do I know when a Time.T is too large? Date.FromTime doesn’t raise any exceptions.
from cm3.
from cm3.
Umm... I didn’t have any problem with Date.FromTime.
Since all the epochs that I know about start from an integral second […]
That’s my assumption as well as well as what is said in the Time interface’s comment. I didn’t get the correct fractional part of VAR now := Time.Now() because now is too large for INTEGER and I was calculating now - FLOAT(FLOOR(now), Time.T) instead of now - Math.floor(now) or maybe just Math.fmod(now, 1.0D0).
from cm3.
from cm3.
Related Issues (20)
- I386_MINGW HOT 2
- Any attempts so resurrect the GCC backend? HOT 1
- Is the LLVM backend working yet?
- The wiki: does mingw-w64-x86_64-gcc is already enough?
- The wiki: add the later steps after the users have bootstrapped cm3
- Is it possible to introduce your own extensions? HOT 18
- Update Trestle GUI toolkit to meet modern real life requirements HOT 5
- An IDE dedicated to Modula-3
- We need a language server for Modula-3 HOT 1
- Update Windows API headers HOT 1
- A modern GUI stack for Modula-3
- Apple Silicon / ARM64_DARWIN support HOT 5
- Modern cmake unable to find COMCTL32 HOT 2
- -g0 option has no effect HOT 2
- BITSIZE of "SET OF SomeEnumeration" has been made flexible? (C backend, ARM64_DARWIN) HOT 2
- [Minor Issue] Bad Cube and Calculator in case cm3 -DM3_BACKEND_MODE=C -DBUILD_DIR=AMD64_LINUX HOT 9
- Packaging for NixOS HOT 11
- MxConfigC.c seems to set a wrong host name for Darwin PPC HOT 1
- it's just non-sense HOT 1
- macOS 14.2.1 on M2 ARM: cannot redefine readonly global symbol: M3_BACKEND_MODE HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cm3.