Thread overview | ||||||||
---|---|---|---|---|---|---|---|---|
|
August 13, 2011 [Issue 6489] New: Should be able to copy double[] to float[] | ||||
---|---|---|---|---|
| ||||
http://d.puremagic.com/issues/show_bug.cgi?id=6489 Summary: Should be able to copy double[] to float[] Product: D Version: unspecified Platform: Other OS/Version: Windows Status: NEW Keywords: rejects-valid Severity: normal Priority: P2 Component: DMD AssignedTo: nobody@puremagic.com ReportedBy: dsimcha@yahoo.com --- Comment #0 from David Simcha <dsimcha@yahoo.com> 2011-08-13 06:41:27 PDT --- void main() { float[] f; double[] d; f[] = d[]; } test9.d(4): Error: cannot implicitly convert expression (d[]) of type double[] to const(float[]) -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- |
August 13, 2011 [Issue 6489] Should be able to copy double[] to float[] | ||||
---|---|---|---|---|
| ||||
Posted in reply to David Simcha | http://d.puremagic.com/issues/show_bug.cgi?id=6489 bearophile_hugs@eml.cc changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |bearophile_hugs@eml.cc --- Comment #1 from bearophile_hugs@eml.cc 2011-08-13 07:05:04 PDT --- Why? And only double->float? int->long too? -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- |
August 13, 2011 [Issue 6489] Should be able to copy double[] to float[] | ||||
---|---|---|---|---|
| ||||
Posted in reply to David Simcha | http://d.puremagic.com/issues/show_bug.cgi?id=6489 --- Comment #2 from David Simcha <dsimcha@yahoo.com> 2011-08-13 11:53:29 PDT --- (In reply to comment #1) > Why? And only double->float? int->long too? Of course int -> long should work, too. Same with anything where implicit conversions are allowed. It's just that double -> float is the first case I stumbled upon. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- |
August 15, 2011 [Issue 6489] Should be able to copy double[] to float[] | ||||
---|---|---|---|---|
| ||||
Posted in reply to David Simcha | http://d.puremagic.com/issues/show_bug.cgi?id=6489 Walter Bright <bugzilla@digitalmars.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |bugzilla@digitalmars.com Platform|Other |All OS/Version|Windows |All Severity|normal |enhancement --- Comment #3 from Walter Bright <bugzilla@digitalmars.com> 2011-08-15 11:50:21 PDT --- What is the compelling rationale for this? Is there a use case that shows it? (Also marked as an enhancement request, as it is not a bug.) -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- |
August 27, 2011 [Issue 6489] Should be able to copy double[] to float[] | ||||
---|---|---|---|---|
| ||||
Posted in reply to David Simcha | http://d.puremagic.com/issues/show_bug.cgi?id=6489 --- Comment #4 from David Simcha <dsimcha@yahoo.com> 2011-08-27 07:34:39 PDT --- The compelling rationale is consistency. I can assign the elements of a float[] to a double[] one-by-one, so why not with array-wise operations? -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- |
August 27, 2011 [Issue 6489] Should be able to copy double[] to float[] | ||||
---|---|---|---|---|
| ||||
Posted in reply to David Simcha | http://d.puremagic.com/issues/show_bug.cgi?id=6489 --- Comment #5 from bearophile_hugs@eml.cc 2011-08-27 16:18:55 PDT --- Please show one or more use case. Do you want it to be like a reinterpret cast? Currently this works: void main() { ushort[4] a = [1, 2, 3, 4]; uint[2] b = cast(uint[2])a; assert(b == [131073, 262147]); } Mixing reinterpret cast with conversion casts is a bad design. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- |
Copyright © 1999-2021 by the D Language Foundation