Click here to Skip to main content
15,890,670 members
Home / Discussions / C#
   

C#

 
AnswerRe: Question with converting double to long Pin
Alaric_18-Mar-10 9:35
professionalAlaric_18-Mar-10 9:35 
GeneralRe: Question with converting double to long Pin
#realJSOP18-Mar-10 9:44
mve#realJSOP18-Mar-10 9:44 
AnswerRe: Question with converting double to long Pin
#realJSOP18-Mar-10 9:46
mve#realJSOP18-Mar-10 9:46 
AnswerRe: Question with converting double to long Pin
Luc Pattyn18-Mar-10 9:55
sitebuilderLuc Pattyn18-Mar-10 9:55 
GeneralRe: Question with converting double to long Pin
Richard MacCutchan18-Mar-10 10:34
mveRichard MacCutchan18-Mar-10 10:34 
GeneralRe: Question with converting double to long Pin
Alaric_18-Mar-10 10:35
professionalAlaric_18-Mar-10 10:35 
GeneralRe: Question with converting double to long Pin
Luc Pattyn18-Mar-10 11:06
sitebuilderLuc Pattyn18-Mar-10 11:06 
AnswerRe: Question with converting double to long Pin
AspDotNetDev18-Mar-10 10:53
protectorAspDotNetDev18-Mar-10 10:53 
Why would you want to round up from 55.99 to 56? 55.99 is not greater than or equal to 56. I'd say rounding down is the correct behavior there. However, for maxValue, then you might want to use Math.Ceiling to round up (well, since Math.Ceiling returns a double, you'd round up then cast to a long if you really want a long for some reason). The alternative would be to not round at all and the comparison will work fine (the longs will be promoted to doubles when you do the comparison.

My guess is somebody did the rounding because they didn't think it through very well. But there may be some perfectly valid reason that would be easier to determine if we know what code was replaced by "....".

Side note: this could possibly have something to do with setting pixel values. That is a common place for integers to be required for comparisons and such when the underlying values are really floating point numbers (e.g., doubles).

Fenryl wrote:
value = 55.99.


FYI, I assume that "." is supposed to be ";".
AnswerRe: Question with converting double to long Pin
PIEBALDconsult18-Mar-10 16:22
mvePIEBALDconsult18-Mar-10 16:22 
Question(2.0) ...wanting to show/hide control within a GridView's TableCell.Controls collection. [modified] Pin
Alaric_18-Mar-10 7:57
professionalAlaric_18-Mar-10 7:57 
AnswerRe: (2.0) ...wanting to show/hide control within a GridView's TableCell.Controls collection. Pin
Alaric_18-Mar-10 10:44
professionalAlaric_18-Mar-10 10:44 
QuestionProblem running deployed application online only - C# .NET 3.51 Pin
Jon Braunsma18-Mar-10 7:42
Jon Braunsma18-Mar-10 7:42 
Questiondegrees to MILS Pin
v17.poornima18-Mar-10 6:47
v17.poornima18-Mar-10 6:47 
AnswerRe: degrees to MILS Pin
PIEBALDconsult18-Mar-10 6:58
mvePIEBALDconsult18-Mar-10 6:58 
GeneralRe: degrees to MILS Pin
Luc Pattyn18-Mar-10 8:16
sitebuilderLuc Pattyn18-Mar-10 8:16 
AnswerRe: degrees to MILS Pin
Keith Barrow18-Mar-10 7:48
professionalKeith Barrow18-Mar-10 7:48 
AnswerRe: degrees to MILS Pin
Saksida Bojan18-Mar-10 7:51
Saksida Bojan18-Mar-10 7:51 
AnswerRe: degrees to MILS [modified] Pin
Dr.Walt Fair, PE18-Mar-10 8:09
professionalDr.Walt Fair, PE18-Mar-10 8:09 
GeneralRe: degrees to MILS Pin
Luc Pattyn18-Mar-10 8:16
sitebuilderLuc Pattyn18-Mar-10 8:16 
GeneralRe: degrees to MILS Pin
Dr.Walt Fair, PE18-Mar-10 8:30
professionalDr.Walt Fair, PE18-Mar-10 8:30 
GeneralRe: degrees to MILS Pin
Luc Pattyn18-Mar-10 8:41
sitebuilderLuc Pattyn18-Mar-10 8:41 
GeneralRe: degrees to MILS Pin
v17.poornima19-Mar-10 3:56
v17.poornima19-Mar-10 3:56 
GeneralRe: degrees to MILS Pin
Dr.Walt Fair, PE19-Mar-10 4:39
professionalDr.Walt Fair, PE19-Mar-10 4:39 
QuestionHow to build a trial version setup using C#.net Pin
eswar pothula18-Mar-10 5:57
eswar pothula18-Mar-10 5:57 
AnswerRe: How to build a trial version setup using C#.net Pin
Saksida Bojan18-Mar-10 7:15
Saksida Bojan18-Mar-10 7:15 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.