Attempting to store float variables in a byte array

I have been trying to save data from an altimeter to an EEPROM over I2C. While my code runs without any errors in the IDE, I have been unable to save the data to the EEPROM. I believe the problem may originate from my attempts to store float values as bytes. I first convert them to integers, and then to bytes, but my understanding is that one integer takes two bytes to store correctly. Any insight into how to correctly store and transmit these values would be appreciated. The links to both parts on Sparkfun can be found below.

Altimeter: https://www.sparkfun.com/products/11084
EEPROM: I2C EEPROM - 256k Bit (24LC256) - COM-00525 - SparkFun Electronics

Here is the complete code I am using to write the data to the EEPROM:

#include <Wire.h>
#include "SparkFunMPL3115A2.h"


MPL3115A2 altimeter;
float startAlt;
float alts [5] = {};
byte altitudeData[180] = {};
int second = 0;
float sum = 0;
float timecheck;
#define EEPROM_ADR 0x64
const int maxEepromWrite = 16;
long currentSpot = 0;
byte tempStore[maxEepromWrite];
byte counter = 0;

void writeEEPROM (long address) {
  Wire.beginTransmission(EEPROM_ADR);
  Wire.write((int)(address >> 8));
  Wire.write((int)(address & 0xFF));
  for (byte x = 0; x < maxEepromWrite; x++)
    Wire.write(tempStore[x]);

  Wire.endTransmission();
}

void setup() {
  Serial.begin(9600);
  Wire.begin();
  altimeter.begin();
  altimeter.setModeAltimeter();
  altimeter.setOversampleRate(7);
  altimeter.enableEventFlags();
  startAlt = altimeter.readAltitudeFt();
  startAlt = startAlt - 5;
  long startTime = millis();
  while (1) {
    float altitude = altimeter.readAltitudeFt();
    sum = sum - alts[5];
    alts[5] = alts[4];
    alts[4] = alts[3];
    alts[3] = alts[2];
    alts[2] = alts[1];
    alts[1] = altitude;
    for (int i = 1; i <= 5; i++) {
      sum = sum + alts[i];
    }
    float altAvg = sum / 5;
    float above = altAvg - startAlt;
    long currentTime = millis();
    long elapsed = currentTime - startTime;
    if (second == 180) {
      altimeter.setModeStandby();
      break;
    }
    if ((elapsed % 1000) <= 10 and (elapsed % 1000) >= 0) {
      int altitudeInt = (int)altitude;
      altitudeData[second] = (byte)altitudeInt;
      Serial.print("Saving data for second ");
      Serial.println(second);
      second += 1;
    }
  }
  int arrpos = 0;
  for(int a = 0; a <= 180; a++) {
    tempStore[arrpos] = altitudeData[a];
    if(arrpos == maxEepromWrite) {
      writeEEPROM(currentSpot);
      currentSpot += maxEepromWrite;
      arrpos = 0;
    }
  }
  Serial.println("Write complete");
}

void loop() {

}

Any help you can offer would be greatly appreciated.

Why are you making things so hard?

Try this

Also a five element array has no element with the index 5.

1. Converting float number into bytes/bits

float x = 12.37;   //This is my float number.
long m = *(long*)&x; // m contains 32-bit pattern for 12.37 according to IEEE-754/binary32 standard
Serial.println(m, HEX); //shows: 4145EB85; actual storage: 01000001010001011110101110000101

2. Separating the composite 32-bit data of Step-1 into 4 bytes.

union
{
    float x; // x should not be initialized here
    byte myArray [4];
} data;

data.x = 12.37;
Serial.println(data.myArray[0], HEX); //Shows lower byte  85

@OP

You must insert delay(5); at the end of Wire.endTransmission() command to allow for the write cycle delay of the EEPROM.

AWOL:
Why are you making things so hard?

Try this

Also a five element array has no element with the index 5.

As far as I know I cannot use the internal Arduino commands since I'm trying to write to an external EEPROM purchased from Sparkfun rather than the ATMega's built-in EEPROM.

But you've got the source to get ideas from...

Maybe even create a device-agnostic class.

Did you fix the array bounds issue?