Calculating RPM using AMS Rotary Sensor (AS5147) on Teensy

I am trying to calculate RPM using a micros() timer every time the sensor returns 0.0, indicating one rotation has been completed. My code is printing out seemingly random numbers between ~30.0 and ~170.0 rpm. How can I fix my code to return correct RPM values?

Here is the code:

//*AMS Rotary Sensor AS5147
// Measures absolute angle position referenced at a set NORTH

#include <SPI.h>



// For TEENSY
#define CSN 9 // 10 Chip Select piN (CSN) pin which activates sensor

unsigned int angle;
float angle_value;
unsigned long startTime;  //some global variables available anywhere in the program
unsigned long stopTime;
float rpm;

void setup()
{
 Serial.begin(115200);
 //Set Pin Modes
 pinMode(CSN, OUTPUT);

 digitalWrite(CSN, HIGH);

 //Initialize SPI
 SPI.begin();

 startTime = micros();
}

void loop()
{
   angle_value = readAngleSensor(CSN);
   //Serial.println(angle_value);
   //Serial.println(startTime);
   if (angle_value == 0.0){
     stopTime = micros();
     rpm = 1000000.0*60.0/(stopTime - startTime);

     //Serial.println("start: "+String(startTime));
     //Serial.println("stop: "+String(stopTime));

     Serial.println(rpm);
     startTime = micros();
   }
}


float readAngleSensor(int chipSelect)
{
 SPI.beginTransaction(SPISettings(10000000, MSBFIRST, SPI_MODE1));

 //Send the Command Frame
 digitalWrite(chipSelect, LOW);
 delayMicroseconds(10);
 SPI.transfer16(0xFFFF);
 digitalWrite(chipSelect, HIGH);
 delayMicroseconds(10);

 digitalWrite(chipSelect, LOW);
 delayMicroseconds(10);
 angle = SPI.transfer16(0xC000);
 SPI.endTransaction();
 digitalWrite(chipSelect, HIGH);
 angle = (angle & (0x3FFF));

 return (float(angle) * 360 / 16348);
}

Prints:
70.75
67.38
63.91
29.11
1428571.38
52.11
1463414.63
1428571.38
47.42
1428571.38
42.29
36.40
705882.38
1428571.38
705882.38
29.23
1428571.38
19.11
1428571.38
1428571.38

Hello!
If You read "How to use this Forum" #7 You will know how to attache the code in a way that makes it much more convienient for many helpers to read it. Better presentation, more and better answers.
First look at the code….

    angle_value = readAngleSensor(CSN);
    //Serial.println(angle_value);
    //Serial.println(startTime);
    if (angle_value == 0.0){

... I ask if the readAngleSensor returns a float? I don't think so.

... if (angle_value == 0.0 will happend very seldom. Use a construction

(val > x1) && (val < x2)

There is a previous topic that may be of use to you.
Please dont respond to it though

Could you also take a few moments to Learn How To Use The Forum.
It will help you get the best out of the forum as a whole.

Bob.