AutoLisp - Real Variable Type Comparison

Hello all,

I was working through some code when I started receiving an unexpected error between REAL type variables. Apparently, real variables won't match with other real variables if it was formerly a string type variable. If you take a real variable, convert it into a string variable, convert it back to a real variable, and then match it with the original real variable, the match will say that the two variables do not equal each other. Below is some code that demonstrates the issue at hand.

AutoLisp Code

(defun C:Test01 (/ rDate1 Date1_1 Date1_2 Date1_3 rDate2 vDate2)
    
    ;; Date REAL
    (setq rDate1 (getvar "DATE"))
    (setq rDate2 rDate1)
    (princ "\\nrDate1  : ")(prin1 rDate1)(princ " ")(prin1 (type rDate1))(terpri)
    (princ "\\nrDate2  : ")(prin1 rDate2)(princ " ")(prin1 (type rDate2))(terpri)

    ;; Date1 to String and then back to real
    (princ "\\nDate1_1 : ")(prin1 (setq Date1_1 (atof (vl-prin1-to-string rDate1)) ))(princ " ")(prin1 (type Date1_1))
    (princ "\\nDate1_2 : ")(prin1 (setq Date1_2 (atof (vl-princ-to-string rDate1)) ))(princ " ")(prin1 (type Date1_2))
    (princ "\\nDate1_3 : ")(prin1 (setq Date1_3 (atof (rtos rDate1 2 12)) ))          (princ " ")(prin1 (type Date1_3))

    ;; Comparison
    (princ "\\n(rDate1  = rDate2) = ")(prin1 (= rDate1  rDate2))(terpri)
    (princ "\\n(Date1_1 = rDate2) = ")(prin1 (= Date1_1 rDate2))(terpri)
    (princ "\\n(Date1_2 = rDate2) = ")(prin1 (= Date1_2 rDate2))(terpri)
    (princ "\\n(Date1_3 = rDate2) = ")(prin1 (= Date1_3 rDate2))(terpri)
    (princ "\\n(rDate1  = rDate2) = ")
        (prin1 (= (atof (rtos rDate1 2 8)) (atof (vl-prin1-to-string rDate2)) ))
        (terpri)
);C:Test01

Ticket: SR:1-25282834927