Comments (4)
Hi @PromoFaux
You have unfortunately caught me in middle of migrating my development machine and I wont be able to investigate this for a bit. I spent some time looking at the code and at first I thought it had something to do with a float never equalling zero, where I might need to change some code to write an extension method along the lines of .IsCloseToZero(...tolerance)
but looking at the code I can't see that being the case.
I'm wondering if it's something odd with floats and implicit casting.
I agree with your title, very interesting.
My code combined with your error kind of suggests the following;
if max is zero, then return 0, but if max is some other non zero number that when cast to a decimal ...will result in zero?
so, at least 1 question is, what non zero integer number when cast to a decimal could result in zero? hence your title.
Please leave this open; the error message suggests a guard clause somewhere, possible implicit casting error etc.
Maybe there's something else we've missed so would prefer to leave this open.
I'm sure I can make that particular bit of code safer at the very least.
these progressbars take an absolute hammering, so it's worth making this code bulletproof.
please ping me again in a few days if I've not pushed a hotfix for this.
txs for raising the issue,
Cheers, Alan
from konsole.
but if max is some other non zero number that when cast to a decimal ...will result in zero?
_max
is an int
, though, so it will only ever be a whole number, right? Even when cast as (decimal)
, it should be {_max }.0
... maybe, so at minimum 1.0
And no worries on timing, like I said, I'm yet to be able to reproduce it so it's clearly an edge case.
from konsole.
floats are sneaky bastards... I blame the floats somewhere .. just havent seen exactly how they did it!
(grin)
I'll take a look in detail in a few days, it's a really interesting bug. ciao, A
from konsole.
I'm labelling this a bug, so that it will get some eyeballs, and will remove with the next patch/fix. (I'm sure we can fix this even if this hardly ever occurs.)
from konsole.
Related Issues (20)
- Prevent console window resize HOT 16
- ProgressBar does not expose current HOT 8
- IWrite allow StringBuilder type of parameter HOT 9
- SplitRows and SplitColumns without border HOT 1
- Embedded CrLf cause window isolation to break.
- HighSpeed writer to support resize on window size change
- Fix spelling, Boxstyle.Thickness to Thickness.
- Menu not explained in the README. HOT 2
- when splitRows with 3 splits, with even number of parent rows, the last split is not expanding by 1 row
- Konsole.Writer.MoveBufferArea throws System.PlatformNotSupportedException on Nix Platforms HOT 4
- ProgressBar not working on Linux HOT 2
- Does window support chinese character text auto wrap? HOT 4
- Trying to use Konsole for First Time HOT 3
- Ability to close boxes. HOT 9
- Support non "lined" borders (line numbers, blue statusbar, and text header) HOT 1
- System.ArgumentOutOfRangeException in ProgressBar.Refresh() HOT 16
- How to prevent console from being moved by user? Snap windows feature is changing size of Console. HOT 1
- The simple initialization of ProgressBar is throwing "The handle is invalid." exception in VSCode while debugging. HOT 7
- Add image support 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 konsole.