Skip to content

Commit e3cb32b

Browse files
authored
Update index.html
1 parent d01f632 commit e3cb32b

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

index.html

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff 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(/asin\s*\(?([0-9./\s-]+)\)?/i);

0 commit comments

Comments
 (0)