fix sqrt math
This commit is contained in:
parent
bb6ea5adea
commit
4bd6c60b99
4 changed files with 7 additions and 3 deletions
1
spec/.gitignore
vendored
Normal file
1
spec/.gitignore
vendored
Normal file
|
@ -0,0 +1 @@
|
|||
GLSLangSpec.4.60.html
|
|
@ -116,7 +116,8 @@ def expand_math(node):
|
|||
return res
|
||||
|
||||
if node.name == 'msqrt':
|
||||
return f'sqrt({expand_math(node.contents[0])})'
|
||||
inner = ' '.join([expand_math(c) for c in math_children(node)])
|
||||
return f'sqrt({inner})'
|
||||
|
||||
raise Exception(f'unknown math node {node.name}: {node}')
|
||||
|
||||
|
|
|
@ -5,3 +5,5 @@ generate-spec:
|
|||
watch:
|
||||
watchexec -e py -c -- just generate-spec
|
||||
|
||||
download-html-spec:
|
||||
wget https://registry.khronos.org/OpenGL/specs/gl/GLSLangSpec.4.60.html
|
||||
|
|
|
@ -13426,7 +13426,7 @@
|
|||
}
|
||||
],
|
||||
"description": [
|
||||
"`length` returns the length of the vector. i.e., ` sqrt() `"
|
||||
"`length` returns the length of the vector. i.e., ` sqrt( x [ 0 ] **2 + x [ 1 ] **2 + …) `"
|
||||
],
|
||||
"versions": [
|
||||
110,
|
||||
|
@ -13453,7 +13453,7 @@
|
|||
}
|
||||
],
|
||||
"description": [
|
||||
"`length` returns the length of the vector. i.e., ` sqrt() `"
|
||||
"`length` returns the length of the vector. i.e., ` sqrt( x [ 0 ] **2 + x [ 1 ] **2 + …) `"
|
||||
],
|
||||
"versions": [
|
||||
400,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue