January 13, 2025 at 12:00 am
Comments posted to this topic are about the item How to Avoid Incorrect Results When Using T-SQL Trigonometric Functions in SQL Server
January 13, 2025 at 5:24 pm
Wouldn't it be nice if Microsoft finally figured out that there's been math co-processors built into CPU chips since the mid-'90's??? Even the decimal datatype had issues with resetting the scale of an interim result to only 6 decimal places.
https://learn.microsoft.com/en-us/sql/t-sql/data-types/precision-scale-and-length-transact-sql
--Jeff Moden
Change is inevitable... Change for the better is not.
January 13, 2025 at 5:45 pm
Just a quick thought, most but not all of the Trigonometry functions in SQL Server are Float in - Float out, make certain that the input matches the output, otherwise, there will be an implicit conversion.
😎
The problem described in the article is implicit conversion. As an example the RADIANS function return data types are based on the input, the PI function returns float.
Always check the BOL for this kind of discrepancies.
Viewing 3 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply