Divide by zero exception

Showing 1-3 of 3 messages
Divide by zero exception Igor Berger 8/20/12 10:56 AM

I'm seeing a divide by zero exception in FluentCassandra 1.1.3 with the following call stack:

System.DivideByZeroException: Attempted to divide by zero.
   at System.DateTimePrecise.GetUtcNow() in C:\Users\igor.berger\Projects\EdiCix\ThirdParty\FluentCassandra\V1.1.3\src\System\DateTimePrecise.cs:line 82
   at FluentCassandra.FluentColumn..ctor(CassandraColumnSchema schema) in C:\Users\igor.berger\Projects\EdiCix\ThirdParty\FluentCassandra\V1.1.3\src\FluentColumn.cs:line 33
   at FluentCassandra.FluentColumnFamily.TrySetColumn(Object name, Object value) in C:\Users\igor.berger\Projects\EdiCix\ThirdParty\FluentCassandra\V1.1.3\src\FluentColumnFamily.cs:line 235

This points to the following line in DateTimePrecise.GetUtcNow():

    DateTime tBaseNew = immutable.BaseTime.AddTicks(((
stopWatchTicks - immutable.ObservedTicks) * ClockTickFrequency) / (

I can see only 2 places where an instance of DateTimePreciseSafeImmutable is created:

1. In the constructor of DateTimePrecise, where Stopwatch.Frequency is assigned to StopWatchFrequency.
I've written a tiny test program to dump Stopwatch.Frequency to the console and it's not zero on the same box.

2. At the end of DateTimePrecise.GetUtcNow(), which has this in the denominator:

    utc.Ticks - immutable.ObservedTime.Ticks + utc.Ticks + utc.Ticks - tBaseNew.Ticks - immutable.ObservedTime.Ticks

When does this become zero?


Re: [FluentCassandra:89] Divide by zero exception Nick Berardi 8/20/12 11:41 AM
Can you file a bug on github?

You received this message because you are subscribed to the Google Groups "FluentCassandra" group.
To post to this group, send email to fluentc...@googlegroups.com.
To unsubscribe from this group, send email to fluentcassand...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msg/fluentcassandra/-/eSbnsN_Mo28J.
For more options, visit https://groups.google.com/groups/opt_out.

Re: [FluentCassandra:89] Divide by zero exception Igor Berger 8/20/12 12:04 PM
Done:  https://github.com/managedfusion/fluentcassandra/issues/48