digitalmars.D.learn - is it bug?
- Alexandr Druzhinin (5/5) Apr 04 2013 on win7 64 bits using dmd 2.062 32 bits this code http://dpaste.dzfl.pl
- =?UTF-8?B?QWxpIMOHZWhyZWxp?= (15/20) Apr 04 2013 The problem is reproducible on Linux as well if you compile with -m32.
- Alexandr Druzhinin (3/23) Apr 04 2013 that works, thank you very much! but provide some link to some good
- =?UTF-8?B?QWxpIMOHZWhyZWxp?= (13/24) Apr 04 2013 I was wrong. What I found is just a workaround. Created a bug for iota:
- Alexandr Druzhinin (3/15) Apr 04 2013 Thank you, Ali.
- Alexandr Druzhinin (5/17) Apr 10 2013 Ali, please, take a look at this http://dpaste.dzfl.pl/44e64eb0
- Alexandr Druzhinin (2/6) Apr 10 2013 it fixes bug (I guess) http://dpaste.dzfl.pl/b9577e70
on win7 64 bits using dmd 2.062 32 bits this code http://dpaste.dzfl.pl /6cca43b5 failed with assert failure: core.exception.AssertError std.range(5288): Assertion failure but on ubuntu 12.04 64 bits, dmd 2.062 64 bit it compiles and works rather well. May be I missed something important with it?
Apr 04 2013
On 04/04/2013 06:27 AM, Alexandr Druzhinin wrote:on win7 64 bits using dmd 2.062 32 bits this code http://dpaste.dzfl.pl /6cca43b5 failed with assert failure: core.exception.AssertError std.range(5288): Assertion failure but on ubuntu 12.04 64 bits, dmd 2.062 64 bit it compiles and works rather well. May be I missed something important with it?The problem is reproducible on Linux as well if you compile with -m32. The following assert fails in range.d: assert(start + count * step >= end); start: 0 count: 83 step: 12.0386 end: 999.2 Even though count * step is seemingly 999.2 as well, due to the inexact nature of floating point calculations the assertion is false. The problem seems to be in your code because your step calculation ignores a remainder. This works: // OLD: step = width / factor; step = (width + factor - 1) / factor; Ali
Apr 04 2013
04.04.2013 21:24, Ali Çehreli пишет:On 04/04/2013 06:27 AM, Alexandr Druzhinin wrote:that works, thank you very much! but provide some link to some good article that explains my mistake, I didn't realize it clearlyon win7 64 bits using dmd 2.062 32 bits this code http://dpaste.dzfl.pl /6cca43b5 failed with assert failure: core.exception.AssertError std.range(5288): Assertion failure but on ubuntu 12.04 64 bits, dmd 2.062 64 bit it compiles and works rather well. May be I missed something important with it?The problem is reproducible on Linux as well if you compile with -m32. The following assert fails in range.d: assert(start + count * step >= end); start: 0 count: 83 step: 12.0386 end: 999.2 Even though count * step is seemingly 999.2 as well, due to the inexact nature of floating point calculations the assertion is false. The problem seems to be in your code because your step calculation ignores a remainder. This works: // OLD: step = width / factor; step = (width + factor - 1) / factor; Ali
Apr 04 2013
On 04/04/2013 08:45 AM, Alexandr Druzhinin wrote:04.04.2013 21:24, Ali Çehreli пишет:I was wrong. What I found is just a workaround. Created a bug for iota: http://d.puremagic.com/issues/show_bug.cgi?id=9877 The following program fails when compiled with -m32: import std.range; void main() { float st = 0.000000000000000; float step = 12.038554191589355; float en = 999.200012207031250; iota(st, en, step); } AliThe problem seems to be in your code because your step calculation ignores a remainder. This works: // OLD: step = width / factor; step = (width + factor - 1) / factor; Alithat works, thank you very much! but provide some link to some good article that explains my mistake, I didn't realize it clearly
Apr 04 2013
05.04.2013 0:26, Ali Çehreli пишет:I was wrong. What I found is just a workaround. Created a bug for iota: http://d.puremagic.com/issues/show_bug.cgi?id=9877 The following program fails when compiled with -m32: import std.range; void main() { float st = 0.000000000000000; float step = 12.038554191589355; float en = 999.200012207031250; iota(st, en, step); } AliThank you, Ali. will be waiting it will be fixed.
Apr 04 2013
05.04.2013 1:26, Ali Çehreli пишет:I was wrong. What I found is just a workaround. Created a bug for iota: http://d.puremagic.com/issues/show_bug.cgi?id=9877 The following program fails when compiled with -m32: import std.range; void main() { float st = 0.000000000000000; float step = 12.038554191589355; float en = 999.200012207031250; iota(st, en, step); } AliAli, please, take a look at this http://dpaste.dzfl.pl/44e64eb0 it's code of ctor of iota float point specialization. And it's strange for me, that pastEnd and (start + count * step) have the same value, but give different comparing results.
Apr 10 2013
11.04.2013 12:13, Alexandr Druzhinin пишет:Ali, please, take a look at this http://dpaste.dzfl.pl/44e64eb0 it's code of ctor of iota float point specialization. And it's strange for me, that pastEnd and (start + count * step) have the same value, but give different comparing results.it fixes bug (I guess) http://dpaste.dzfl.pl/b9577e70
Apr 10 2013