Comments (4)
from fbc.
Related thread: https://freebasic.net/forum/viewtopic.php?f=3&t=26921&p=250211
Adding more zeroes before the decimal point further decrements the exponent, e.g. format(0, "0000e+0")
-> 0000e-4
.
It seems to follow the same pattern as if 0.1 were used, e.g. format(0.1, "0000e+0")
-> 1000e-4
.
Ideally the exponent should probably always be 0. Probably just need to make zero a special case...
from fbc.
I think I can fix this by simply preventing the line https://github.com/freebasic/fbc/blob/1.07.1/src/rtlib/str_format.c#L286 from executing when value
is zero.
But I've found further oddities, e.g. with the format string 000e+0
:
0.1234
-> 123e-3
0.0000
-> 000e-3
(or 000e+0
with the suggested fix)
1.2340
-> 001e+0
In the latter case it should presumably be 123e-2
, but I don't currently have quick access to VB's Format
to compare...
from fbc.
Fixed by #272
from fbc.
Related Issues (20)
- The _DISPATCHER_HEADER structure is incorrect HOT 2
- _IRP Statement bugfix HOT 6
- How to modify FB code to use FB built-in functions in driver development? HOT 1
- unit-tests stuck on ascii HOT 8
- FreeBASIC support for Linux on PowerPC and PowerPC64? HOT 4
- libstdc++-related problems in log-tests HOT 10
- Support for SOURCE_DATE_EPOCH HOT 4
- Golang and FreeBasic HOT 1
- File Append Bug HOT 1
- Date Format Bug HOT 2
- Could fbc achieve the same effect as making a share section in dll HOT 1
- cannot find -ldisphelper HOT 2
- build FreeBasic on macOS 13.1 with clang HOT 1
- if statement fail on div0 HOT 6
- MOVE TO DISCUSSIONS: hdpmi32 and cwsdpmi in dosbox HOT 2
- mangled out
- mangled output windows commandline when using wstr and pipe
- Brecht Sanders MinGW-W64 refrence possibly rather excessive in compiled exe with gcc HOT 9
- fbc64 version 1.20 crashed under Windows 10 64 bit HOT 1
- Invalid assignment/conversion, before 'Then' in function returned Const ZString Ptr HOT 1
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 fbc.