angle between 2 vectors

Hello
I'm looking for a script to know angle bteween two vectors (in fact 2 normals to know the angle between two planes)
I found this, but when I get a value of 176 degrees for exemple I can't say if the angle is inside or outside the mesh normals...
-------------------
(
try(
local savesnap=snapMode.active
snapMode.active=true

pta = pickpoint snap:#3d
obj = $
a= polyop.getFaceSelection obj as array
XX= polyop.getFaceNormal obj a[1]
YY= polyop.getFaceNormal obj a[2]
theAngletrunc = ((acos(dot XX YY )) * 10 ) as integer
theAnglefloat = theAngletrunc as float
theAngle = (theAnglefloat / 10)

fordisplay = (theAngle as string+" / "+(abs(theAngle - 180)) as string)
txt = text()
txt.text = fordisplay
txt.font = "Txt"
txt.wirecolor = black
txt.alignment = 2
txt.size = 1
txt.pos= pta
rotate txt (angleaxis 90 [1,0,0])
snapMode.active=savesnap
)
catch (print "ERROR!")
)
----------------