Click here to Skip to main content
15,895,011 members
Home / Discussions / C#
   

C#

 
Questionhow to mange seat booking for online movir ticket booking Pin
Member 1032370414-Apr-14 19:06
Member 1032370414-Apr-14 19:06 
AnswerRe: how to mange seat booking for online movir ticket booking Pin
Peter Leow14-Apr-14 19:28
professionalPeter Leow14-Apr-14 19:28 
AnswerRe: how to mange seat booking for online movir ticket booking Pin
Bernhard Hiller14-Apr-14 22:38
Bernhard Hiller14-Apr-14 22:38 
QuestionSimple calculation with double or float numbers Pin
Mario 5614-Apr-14 13:13
Mario 5614-Apr-14 13:13 
AnswerRe: Simple calculation with double or float numbers Pin
Dave Kreskowiak14-Apr-14 15:13
mveDave Kreskowiak14-Apr-14 15:13 
GeneralRe: Simple calculation with double or float numbers Pin
Mario 5615-Apr-14 2:31
Mario 5615-Apr-14 2:31 
GeneralRe: Simple calculation with double or float numbers Pin
Dave Kreskowiak15-Apr-14 14:36
mveDave Kreskowiak15-Apr-14 14:36 
AnswerRe: Simple calculation with double or float numbers Pin
harold aptroot14-Apr-14 21:38
harold aptroot14-Apr-14 21:38 
The ability to write down things like 4.02 is highly misleading. There is no double with the precise value of 0.02 (or 4.02), because doubles are really an integer multiplied by a power of two, and there is no power of two 2n such that x*2n = 0.02 for some integer x.
So when you write 4.02, that's immediately where the trouble starts - you don't get 4.02 because it doesn't exist.

But anyway, you're working with measurements here, and these numbers are clearly correct to many decimals, at least until you cast it to ushort. Casting to ushort is problematic - it will round down, and so the "slightly less than 4" that was still correct (though it looks incorrect) ends up as 3, which is suddenly far from correct.

I'm not really sure what you should do about that. You could trying rounding, but that also those cases where the answer you get differs from the desired answer by 1.
GeneralRe: Simple calculation with double or float numbers Pin
Mario 5615-Apr-14 2:43
Mario 5615-Apr-14 2:43 
GeneralRe: Simple calculation with double or float numbers Pin
harold aptroot15-Apr-14 2:48
harold aptroot15-Apr-14 2:48 
QuestionI can not add record to my table Pin
ehabaziz200114-Apr-14 8:37
ehabaziz200114-Apr-14 8:37 
SuggestionRe: I can not add record to my table Pin
Richard Deeming14-Apr-14 8:53
mveRichard Deeming14-Apr-14 8:53 
GeneralRe: I can not add record to my table Pin
ehabaziz200117-Apr-14 11:52
ehabaziz200117-Apr-14 11:52 
QuestionHow to reuse event Pin
Member 1034709214-Apr-14 4:30
Member 1034709214-Apr-14 4:30 
AnswerRe: How to reuse event Pin
OriginalGriff14-Apr-14 5:08
mveOriginalGriff14-Apr-14 5:08 
AnswerRe: How to reuse event Pin
Dave Kreskowiak14-Apr-14 5:09
mveDave Kreskowiak14-Apr-14 5:09 
GeneralRe: How to reuse event Pin
Member 1034709215-Apr-14 18:39
Member 1034709215-Apr-14 18:39 
GeneralRe: How to reuse event Pin
Dave Kreskowiak15-Apr-14 18:44
mveDave Kreskowiak15-Apr-14 18:44 
GeneralRe: How to reuse event Pin
lukeer15-Apr-14 20:54
lukeer15-Apr-14 20:54 
GeneralRe: How to reuse event Pin
Dave Kreskowiak16-Apr-14 1:26
mveDave Kreskowiak16-Apr-14 1:26 
GeneralRe: How to reuse event Pin
Member 1034709216-Apr-14 1:08
Member 1034709216-Apr-14 1:08 
GeneralRe: How to reuse event Pin
Dave Kreskowiak16-Apr-14 1:27
mveDave Kreskowiak16-Apr-14 1:27 
GeneralRe: How to reuse event Pin
Member 1034709216-Apr-14 4:21
Member 1034709216-Apr-14 4:21 
QuestionC# use all controls on different form Pin
t..bdiesel14-Apr-14 2:35
t..bdiesel14-Apr-14 2:35 
AnswerRe: C# use all controls on different form Pin
joost.versteegen14-Apr-14 20:42
joost.versteegen14-Apr-14 20:42 

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.