Replies: 8 comments 3 replies
-
I don't know 🤷 Their bullet points: As for precision, you would have to compare I guess and report any discrepancies that we can fix by either improving the conversion function or adding direct conversions between pairs of units. There is no backlog of conversions to fix and I am not aware of any particular imprecise units today. |
Beta Was this translation helpful? Give feedback.
-
Ok, So per the test Length L2 = new Length(1, LengthUnit.Mile); it does have a small error where there is a little bit added but it is 0.000000000007inch error on 1 mile to inches conversion. You outline that so it is ok since inches isnt really a good measurement if running a mile. LOL There is a big difference though. Your code wont allow Torque = Length * Force. The mathematical advantage is a big improvement since in practical application this is needed. What would it take to get that code added to the library. We can basically copy it since it is MIT. |
Beta Was this translation helpful? Give feedback.
-
I dont do a bunch on github so excuse my ignorance. but what would it take to merge or get MadsKirkFoged to join your repository? It looks as you maintain it much better and it would make more sence to join forces rather then work independently. I have great interest in this being mixed since i am looking to use the concept in a project doing physics calculations. So If you want to work with me we can add and put the two together. I am able to at minimum to do the testing. |
Beta Was this translation helpful? Give feedback.
-
I actually began some of the fundamental underpinnings with BaseUnits etc. to allow this in 2018. I’m a bit behind in finishing 😂 I should try to take a look again. I have not looked what EngineeringUnits is doing, but being able to do math operations on arbitrary types is semi in place. We can use the LHS to infer the type after unit math is complete. |
Beta Was this translation helpful? Give feedback.
-
Yes. Also there is a memory leak in this. We can not use it in a loop filling a array of position, velocity and acceleration. The memory usage jumps from 22Mb to 2Gb and crashes so i have to ise double and calculate in a base unit then convert on beginning and end. So im guessing this is not like. Private length;Public mm get return length. Set length =value Public inch. Get return length/25.4 set. length = value *25.4. Since that should not add memory since it is only holding one value. Sent from my iPhoneOn Oct 17, 2023, at 9:23 PM, Tristan Milnthorp ***@***.***> wrote:
I actually began some of the fundamental underpinnings with BaseUnits etc. to allow this in 2018. I’m a bit behind in finishing 😂
I should try to take a look again. I have not looked what EngineeringUnits is doing, but being able to do math operations on arbitrary types is semi in place. We can use the LHS to infer the type after unit math is complete.
—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you authored the thread.Message ID: ***@***.***>
|
Beta Was this translation helpful? Give feedback.
-
Ill put together a test for you give me a few days. This is a side project for me. Sent from my iPhoneOn Oct 18, 2023, at 7:14 PM, Tristan Milnthorp ***@***.***> wrote:
That sounds like a nasty leak. Do you have some trivial code to help reproduce quickly?
—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you authored the thread.Message ID: ***@***.***>
|
Beta Was this translation helpful? Give feedback.
-
Well, I got a little time here thinking about this and ran through the code to make a test and found the issue. It was on my end. The small rounding error in Units caused it to stick in one of the loops and that is what was causing it to run off. I had to look at velocity in the loop too since it started going backwards since it missed position by 0.000005. LOL . Sorry I jumped to quick on this. |
Beta Was this translation helpful? Give feedback.
-
Btw Tristan. I am Robert that friended you on LinkedIn. Sent from my iPhoneOn Oct 19, 2023, at 9:55 AM, Tristan Milnthorp ***@***.***> wrote:
No problem. Thanks for letting us know!
—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you authored the thread.Message ID: ***@***.***>
|
Beta Was this translation helpful? Give feedback.
-
From the Engineering Units Page
Unit checks has been moved from Compile time to runtime. In UnitsNet if you do mathematical operations on units that doesnt turn into the expected unit, you're get an error before you compile the program. In EngineeringUnits you still have the same check but you will get the error when you run the program.
Beta Was this translation helpful? Give feedback.
All reactions