File tree Expand file tree Collapse file tree 1 file changed +8
-6
lines changed
Expand file tree Collapse file tree 1 file changed +8
-6
lines changed Original file line number Diff line number Diff line change @@ -783,20 +783,22 @@ <h4 style="font-size:160%;margin:7px">Trigonometry</h4>
783783 let minDiff = Infinity ;
784784
785785 for ( const key in trig ) {
786- const approx = trig [ key ] [ funcType ] ?. value ?. approx ?? trig [ key ] [ funcType ] ?. value ;
787- if ( ! approx ) continue ;
786+ const raw = trig [ key ] [ funcType ] ;
787+ if ( typeof raw !== 'number' ) continue ;
788788
789- const diff = Math . abs ( parseFloat ( approx ) - value ) ;
789+ const diff = Math . abs ( raw - value ) ;
790790 if ( diff < minDiff ) {
791791 minDiff = diff ;
792- bestMatch = { angle : key , approx } ;
792+ bestMatch = {
793+ angle : key ,
794+ approx : raw
795+ } ;
793796 }
794797 }
795798
796799 return bestMatch ;
797800}
798-
799-
801+
800802 function queryAsin ( input ) {
801803 // Normalize and extract the value: "asin 0.5" or "asin(0.5)"
802804 const match = input . match ( / a s i n \s * \( ? ( [ 0 - 9 . / \s √ - ] + ) \) ? / i) ;
You can’t perform that action at this time.
0 commit comments